package www.wen.com.common.lib.app

import android.app.Application
import android.content.Context
import com.netease.nimlib.sdk.NIMClient
import com.netease.nimlib.sdk.util.NIMUtil
import dagger.hilt.android.HiltAndroidApp
import www.wen.com.common.lib.data.db.database.AppDatabase
import www.wen.com.common.lib.data.network.ApiService
import javax.inject.Inject
import kotlin.properties.Delegates


/**
 * @author WEN
 * @Description:
 * @date 2020/11/1 21:42
 */

open class BaseApplication : Application() {

    @Inject
    lateinit var apiService: ApiService

    @Inject
    lateinit var db: AppDatabase

    @Inject
    lateinit var application: Context

    companion object {

        var CONTEXT: Context by Delegates.notNull()

        var API: ApiService by Delegates.notNull()

        var DB: AppDatabase by Delegates.notNull()

    }

    override fun onCreate() {
        super.onCreate()
        CONTEXT = application
        API = apiService
        DB = db
    }

}